<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML>
<html>
	<head>
		<base href="<%=basePath%>">

		<title>文章列表</title>
		<link rel="stylesheet" type="text/css"
			href="<%=basePath%>jslib/bootstrap/css/bootstrap.css">
		<link rel="stylesheet" type="text/css"
			href="<%=basePath%>css/theme.css">
		<link rel="stylesheet"
			href="<%=basePath%>jslib/font-awesome/css/font-awesome.css">
		<script src="<%=basePath%>jslib/jquery-1.7.2.min.js"
			type="text/javascript"></script>
	</head>

	<body class="content1">
		<div class="header">
			<h1 class="page-title">
				文章管理
			</h1>
		</div>
		<ul class="breadcrumb">
			<li>
				<a href="<%=basePath%>/sys/welcome.jsp">Home</a>
				<span class="divider">/</span>
			</li>
			<li class="active">
				审核文章
			</li>
		</ul>
		<div class="container-fluid">
			<div class="row-fluid">
			<form class="form-inline" method="post"
					action="<%=basePath%>sys/art?cmd=toauditing">
					<input class="input-xlarge" placeholder="文章名称..." name="sname"
						type="text" value="${param.sname}">
					<input class="btn icon-search" type="submit" value="查询" />
				
				</form>
				

				<div class="well">
					<table class="table">
						<thead>
							<tr>
								<th>
									文章标题
								</th>
								<th>
									文章作者
								</th>
								<th>
									图文图片
								</th>
								<th>
									添加时间
								</th>
								<th colspan="2" style="width: 90px;text-align:center">
									审核状态
								</th>
								<th  colspan="2" style="width: 90px;text-align:center">
									编辑
								</th>
							</tr>
						</thead>
						<tbody>
							<c:forEach items="${pager.list}" var="item">
								<tr>
									<td>
										${item.title}
									</td>
									<td>
										${item.author}
									</td>
									<td>
										<c:if test="${item.pic=='无'}">
											无
										</c:if>
										<c:if test="${item.pic!='无'}">
											<img src="<%=basePath%>/upload/${item.pic}" style="width:50px;height:50px;"/>
										</c:if>
									</td>
									<td>
										${item.createdate}
									</td>
									<td colspan="2" style="width: 90px;text-align:center">
										<c:if test="${item.artstate==0}">
											<a href="<%=basePath%>sys/art?cmd=auditing&aid=${item.aid}&state=2&aduser=${audinguser}&index=${empty param.index?1:param.index}">待审核</a>
										</c:if>
										
										<c:if test="${item.artstate==2}">
											审核通过
										</c:if>
										<c:if test="${item.artstate==2}">
											<a href="<%=basePath%>sys/art?cmd=auditing&aid=${item.aid}&aduser=${audinguser}&state=1&index=${empty param.index?1:param.index}">冻结</a>
										</c:if>
											<c:if test="${item.artstate==1}">
											<a href="<%=basePath%>sys/art?cmd=auditing&aid=${item.aid}&aduser=${audinguser}&state=0&index=${empty param.index?1:param.index}">解冻</a>
										</c:if>
									</td>
									<td colspan="2" style="width: 90px;text-align:center">
										<a href="<%=basePath%>sys/art?cmd=toview&aid=${item.aid}&nid=${item.nid}">查看文章信息</a>
										&ensp;
										<a href="<%=basePath%>sys/art?cmd=towiewart&aid=${item.aid}">查看文章</a>
										&ensp;<br/>
										<a href="<%=basePath%>sys/art?cmd=delete&aid=${item.aid}" onclick="return confirm('确定要删除吗?')">删除</a>
									</td>
								</tr>
							</c:forEach>
						</tbody>
					</table>
					<div class="pagination pagination-right">
						<ul>
							<li>
								<a>共计：${pager.pagectrl.pagecount}页/${pager.pagectrl.rscount}条记录</a>
							</li>
							
							<li>
								<c:if test="${pager.pagectrl.currentindex==1}" var="fp">
									<a style="disabled:true">上一页</a>
								</c:if>
								<c:if test="${!fp}">
									<a href="<%=basePath%>sys/art?cmd=toauditing&index=${pager.pagectrl.currentindex-1}">上一页</a>
								</c:if>
							</li>						
							
							<c:forEach begin="${pager.pagectrl.minpage}" step="1" end="${pager.pagectrl.maxpage}" var="index">
							<li>
								<c:if test="${pager.pagectrl.currentindex==index}" var="t">
									<a style="color:red;background-color:#bbb">${index}</a>
								</c:if>
								<c:if test="${!t}">
								<a href="<%=basePath%>sys/art?cmd=toauditing&index=${index}">${index}</a>
								</c:if>
							</li>
							</c:forEach>
							
							<li>
								<c:if test="${pager.pagectrl.currentindex==pager.pagectrl.pagecount}" var="fp">
									<a style="disabled:true">下一页</a>
								</c:if>
								<c:if test="${!fp}">
									<a href="<%=basePath%>sys/art?cmd=toauditing&index=${pager.pagectrl.currentindex+1}">下一页</a>
								</c:if>
							</li>
						</ul>
					</div>
				</div>
			</div>
		</div>
		
	</body>
</html>
